#include<iostream>
using namespace std;
int main(){
    int n;
    while (cin>>n&&n>0&&n<1000)
    {
        int a[1000],c=0;
        while (n!=0)
        {
            a[c]=n%2;
            n=n/2;
            c++;
        }
        for (int i = c-1; i>=0; i--)
        {
            cout<<a[i];
        }
        cout<<endl;
    }
    
}